// 引入mongoose
const mongoose = require("mongoose");
const moment = require("moment-timezone");
// 创建我的求购集合规则
const myWannaBuySchema = new mongoose.Schema({
    // 修改时间
    modify: {
        type: String,
        default: moment().tz("Asia/Shanghai").format("YYYY/MM/DD HH:mm:ss"),
    },
    // 是否被删除
    display: {
        type: Boolean,
        required: [true, "是否被铲除不能为空"],
    },
    // 用户id
    uid: {
        type: mongoose.Schema.Types.ObjectId,
        ref: "user",
        required: [true, "求购用户id不能为空"],
    },
    // 求购商品id
    qid: {
        type: mongoose.Schema.Types.ObjectId,
        ref: "goods",
        required: [true, "求购商品id不能为空"],
    },
});
// 创建我的求购集合
const MyWannaBuy = mongoose.model("MyWannaBuy", myWannaBuySchema);
// 导出集合
module.exports = MyWannaBuy;